/*
** PICKFILE.C: Lets the user select a file in the current
** directory.
*/

#include <stdio.h>
#include <pictor.h>

COLORSTRUCT colors = {
   foreback(BOLD+CYAN,BLUE),
   foreback(BOLD+WHITE,CYAN),
   foreback(BLACK,WHITE),
   foreback(BOLD+WHITE,WHITE)
};

void main()
{
   char buffer[45];
   char *cptr;

   /* initialize the library */
   initvideo();

   cptr = pickfile("*.*","Pick a File",&colors);
   if(cptr != NULL) {
      sprintf(buffer,"You selected %s",cptr);
      messagebox(buffer,NULL,MB_OK,&colors);
   }
   else {
      messagebox("You pressed <Escape>",NULL,MB_OK,
         &colors);
   }
}
